﻿<UserControl x:Class="AnthStat.WPF.Presentation.Controls.MainMenu"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:viewmodels="clr-namespace:AnthStat.WPF.Applications;assembly=AnthStat.WPF.Applications"
             xmlns:controls="clr-namespace:AnthStat.WPF.Presentation.Controls"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="500">
    <Grid  Background="#EFF2FA">
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid Background="{StaticResource AccentBrush}" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            
            <TextBlock Foreground="White" VerticalAlignment="Center" Margin="20, 10, 0, 10" FontSize="24">AnthStat</TextBlock>

            <StackPanel Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal" Margin="0, 4, 0, 4">
                <Button Style="{StaticResource BlankButtonStyle}" 
                        Margin="20, 0, 40, 0"
                        DataContext="{StaticResource SettingsViewModel}"
                        Command="{Binding ToggleShowSettingsCommand}">
                    <Path 
                        Fill="White"
                        Stretch="Fill"
                        Height="28"
                        Width="28"
                        Data="F1 M 38,23.5C 38.8643,23.5 39.7109,23.5756 40.5337,23.7206L 42.6275,18.5381L 48.1901,20.787L 46.0964,25.9692C 47.6473,27.0149 48.9851,28.3527 50.0308,29.9036L 55.213,27.8099L 57.4619,33.3725L 52.2794,35.4664C 52.4244,36.2891 52.5,37.1357 52.5,38C 52.5,38.8643 52.4244,39.7109 52.2794,40.5337L 57.4619,42.6275L 55.213,48.1901L 50.0308,46.0964C 49.0795,47.5073 47.8865,48.7418 46.5112,49.7405L 48.7844,54.8462L 43.3041,57.2891L 41.0307,52.1828C 40.0533,52.3906 39.0394,52.5 38,52.5C 37.1357,52.5 36.2891,52.4244 35.4664,52.2794L 33.3725,57.462L 27.8099,55.213L 29.9036,50.0309C 28.3527,48.9851 27.0149,47.6473 25.9691,46.0964L 20.787,48.1901L 18.538,42.6275L 23.7206,40.5336C 23.5756,39.7109 23.5,38.8643 23.5,38C 23.5,37.1357 23.5756,36.2891 23.7206,35.4664L 18.538,33.3725L 20.787,27.8099L 25.9691,29.9036C 26.9205,28.4927 28.1135,27.2582 29.4889,26.2594L 27.2157,21.1537L 32.6959,18.7109L 34.9694,23.8172C 35.9468,23.6094 36.9606,23.5 38,23.5 Z M 38,28C 32.4771,28 28,32.4772 28,38C 28,43.5229 32.4771,48 38,48C 43.5228,48 48,43.5229 48,38C 48,32.4772 43.5228,28 38,28 Z "></Path>
                </Button>
            </StackPanel>
        </Grid>
        
        <Grid Grid.Row="1" Grid.Column="0" Margin="20">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0" Margin="5">
                <TextBlock FontWeight="SemiBold" FontSize="15" Text="WELCOME" />
            </StackPanel>
            
            <Border Background="{StaticResource AccentLightBrush}" BorderThickness="0, 3, 0, 0" BorderBrush="{StaticResource AccentDarkBrush}" Grid.Row="1" Width="300" Padding="10">

                <StackPanel>
                    <TextBlock Foreground="#EFF2FA" FontSize="14" FontWeight="Normal" TextWrapping="Wrap" Text="To create an new AnthStat project, click the New Project button below." />
                    <StackPanel Height="20" />
                    <TextBlock Foreground="#EFF2FA" FontSize="14" FontWeight="Normal" TextWrapping="Wrap" Text="To open an new AnthStat project, left-click on the desired project in the Current Projects list to the right." />
                    <StackPanel Height="20" />
                    <StackPanel Height="1" Background="White" />

                    <StackPanel Height="20" />

                    <Button Style="{StaticResource BlankButtonStyle}" 
                            HorizontalAlignment="Left"
                            Command="{Binding CreateProjectCommand}">
                        <StackPanel Orientation="Horizontal">
                            <Grid>
                                <Ellipse Stroke="White" StrokeThickness="2" Width="38" Height="38" />
                                <Path Width="24" Height="24" Stretch="Fill" Fill="White" Data="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z "/>
                            </Grid>
                            <TextBlock Margin="10, 0, 0 ,0" Foreground="White" FontSize="16" FontWeight="Bold" TextWrapping="NoWrap" Text="New project" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button>
                    
                    <StackPanel Height="20" />

                    <Button Style="{StaticResource BlankButtonStyle}" 
                            HorizontalAlignment="Left"
                            Command="{Binding CalculatorCommand}">
                        <StackPanel Orientation="Horizontal">
                            <Grid>
                                <Ellipse Stroke="White" StrokeThickness="2" Width="38" Height="38" />
                                <Path Width="16" Height="24" Stretch="Fill" Fill="White" Data="F1 M 25,17L 51,17C 52.3117,17 54,18.6883 54,20L 54,56C 54,57.3117 52.3117,59 51,59L 25,59C 23.6883,59 22,57.3117 22,56L 22,20C 22,18.6883 23.6883,17 25,17 Z M 26.9999,20.0001C 25.8954,20.0001 24.9999,20.8956 24.9999,22.0001L 24.9999,25.0001C 24.9999,26.1047 25.8954,27.0001 26.9999,27.0001L 48.9999,27.0001C 50.1044,27.0001 50.9999,26.1047 50.9999,25.0001L 50.9999,22.0001C 50.9999,20.8956 50.1044,20.0001 48.9999,20.0001L 26.9999,20.0001 Z M 27,30.0001C 25.8954,30.0001 25,30.8955 25,32.0001L 25,34C 25,35.1046 25.8954,36 27,36L 28.9999,36.0001C 30.1045,36.0001 30.9999,35.1046 30.9999,34.0001L 31,32.0001C 31,30.8955 30.1045,30.0001 29,30.0001L 27,30.0001 Z M 37,30.0001C 35.8954,30.0001 35,30.8955 35,32.0001L 34.9999,34C 34.9999,35.1046 35.8954,36 36.9999,36L 39,36C 40.1045,36 41,35.1046 41,34L 41,32.0001C 41,30.8955 40.1045,30.0001 39,30.0001L 37,30.0001 Z M 46.9999,30.0001C 45.8954,30.0001 44.9999,30.8955 44.9999,32.0001L 44.9999,34C 44.9999,35.1046 45.8953,36 46.9999,36L 48.9999,36C 50.1045,36 50.9999,35.1046 50.9999,34L 50.9999,32.0001C 50.9999,30.8955 50.1045,30.0001 48.9999,30.0001L 46.9999,30.0001 Z M 27,39C 25.8954,39 25,39.8955 25,41L 25,43C 25,44.1046 25.8954,45 27,45L 29,45.0001C 30.1045,45.0001 31,44.1046 31,43.0001L 31,41.0001C 31,39.8955 30.1045,39.0001 29,39.0001L 27,39 Z M 37,39.0001C 35.8954,39.0001 35,39.8955 35,41.0001L 35,43.0001C 35,44.1046 35.8954,45.0001 37,45.0001L 39,45C 40.1045,45 41,44.1046 41,43L 41,41.0001C 41,39.8955 40.1045,39.0001 39,39.0001L 37,39.0001 Z M 47,39C 45.8954,39 45,39.8955 45,41L 44.9999,43C 44.9999,44.1046 45.8954,45 46.9999,45L 49,45C 50.1045,45 51,44.1046 51,43L 51,41C 51,39.8955 50.1045,39 49,39L 47,39 Z M 27,49.0001C 25.8954,49.0001 25,49.8955 25,51.0001L 25,53C 25,54.1046 25.8954,55 27,55L 29,55C 30.1045,55 31,54.1046 31,53.0001L 31,51.0001C 31,49.8955 30.1045,49.0001 29,49.0001L 27,49.0001 Z M 37,49.0001C 35.8954,49.0001 35,49.8955 35,51.0001L 35,53.0001C 35,54.1046 35.8954,55 37,55L 39,55C 40.1045,55 41,54.1046 41,53L 41,51.0001C 41,49.8955 40.1045,49.0001 39,49.0001L 37,49.0001 Z M 47,49C 45.8954,49 45,49.8955 45,51L 45,53C 45,54.1046 45.8954,55 47,55L 49,55C 50.1045,55 51,54.1046 51,53L 51,51C 51,49.8954 50.1046,49 49,49L 47,49 Z "/>
                            </Grid>
                            <TextBlock Margin="10, 0, 0 ,0" Foreground="White" FontSize="16" FontWeight="Bold" TextWrapping="NoWrap" Text="Anthropometric calculator" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button>

                    <StackPanel Height="20" />

                    <Button Style="{StaticResource BlankButtonStyle}" 
                            HorizontalAlignment="Left"
                            Command="{Binding ToggleAboutBoxCommand}">
                        <StackPanel Orientation="Horizontal">
                            <Grid>
                                <Ellipse Stroke="White" StrokeThickness="2" Width="38" Height="38" />
                                <Path Width="10" Height="24" Stretch="Fill" Fill="White" Data="F1 M 31.6666,30.0834L 42.7499,30.0834L 42.7499,33.2501L 42.7499,52.2501L 45.9165,52.2501L 45.9165,57.0001L 31.6666,57.0001L 31.6666,52.2501L 34.8332,52.2501L 34.8332,34.8335L 31.6666,34.8335L 31.6666,30.0834 Z M 38.7917,19C 40.9778,19 42.75,20.7722 42.75,22.9583C 42.75,25.1445 40.9778,26.9167 38.7917,26.9167C 36.6055,26.9167 34.8333,25.1445 34.8333,22.9583C 34.8333,20.7722 36.6055,19 38.7917,19 Z "/>
                            </Grid>
                            <TextBlock Margin="10, 0, 0 ,0" Foreground="White" FontSize="16" FontWeight="Bold" TextWrapping="NoWrap" Text="About" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button>

                </StackPanel>
        </Border>
        </Grid>

        <Grid Grid.Row="1" Grid.Column="1" Margin="0, 20, 0, 0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0" Margin="5">
                <TextBlock FontWeight="SemiBold" FontSize="15" Text="CURRENT PROJECTS" />
            </StackPanel>
            
            <ScrollViewer Grid.Row="1" x:Name="svMain" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Hidden" >
                <Grid Margin="0, 0, 0, 0">
                    <controls:ProjectsSummaryView MaxHeight="{Binding ElementName=svMain, Path=ActualHeight}" ItemsSource="{Binding Projects}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" 
                                   />
                </Grid>
            </ScrollViewer>
        </Grid>

        <Grid Grid.RowSpan="3" Grid.ColumnSpan="3" Background="#55000000"  Visibility="{Binding IsShowingNewProject, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}">
            <!--<controls:NewProject Width="300" Height="300" />-->
            <controls:ProjectTypeChooser  Width="600" Height="500" />
        </Grid>

        <Grid Grid.RowSpan="3" Grid.ColumnSpan="3" Background="#55000000" Visibility="{Binding IsShowingCalculator, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}">
            <controls:NutritionalCalculator Width="700" Height="530" DataContext="{Binding}"  />
        </Grid>

        <Grid Grid.RowSpan="3" Grid.ColumnSpan="3" Background="#55000000" Visibility="{Binding IsShowingAboutBox, Converter={StaticResource BooleanToVisibilityConverter}, FallbackValue=Collapsed}">
            <controls:About />
        </Grid>

        <controls:SettingsPanel Grid.Row="0" Grid.RowSpan="3" Grid.ColumnSpan="3" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0, 5, 20, 0" DataContext="{StaticResource SettingsViewModel}" Visibility="{Binding IsShowingSettingsPanel, Converter={StaticResource BooleanToVisibilityConverter}}" />
    </Grid>
</UserControl>
